package utils

import (
	"gitee.com/yxd1990/golang-common/myType"
	"time"
)

func IsInSameDate(time1, time2 interface{}) bool {
	var year1, year2 int
	var month1, month2 time.Month
	var day1, day2 int
	if t1, ok := time1.(*time.Time); ok {
		year1, month1, day1 = t1.Date()
	} else if t1, ok := time1.(*myType.Time); ok {
		year1, month1, day1 = t1.Date()
	}

	if t2, ok := time2.(*time.Time); ok {
		year2, month2, day2 = t2.Date()
	} else if t2, ok := time2.(*myType.Time); ok {
		year2, month2, day2 = t2.Date()
	}
	return year1 == year2 && month1 == month2 && day1 == day2
}
